create table jms_dm.dm_network_retention_detail_dt
(
    end_agent_code           varchar(100) COMMENT '代理区编码',
    end_franchisee_code      varchar(100) COMMENT '加盟商编码',
    final_sign_network_code  varchar(100) COMMENT '派件网点编码',
    third_code               varchar(100) COMMENT '三段码',
    end_center_send_time     varchar(100) COMMENT '末端重心发件时间',
    final_plan_sign_date     date COMMENT '规划签收日期',
    final_plan_sign_time     varchar(100) COMMENT '规划签收时间',
    aging_sign_count_type    varchar(100) COMMENT '时效签收类型',
    billcode                 varchar(100) COMMENT '运单号',
    final_sign_network_name  varchar(100) COMMENT '派件网点名称',
    end_center_code          varchar(100) COMMENT '转运中心/集散编码',
    end_center_name          varchar(100) COMMENT '末端中心/集散名称',
    end_manage_region_code   varchar(100) COMMENT '管理大区名称',
    end_manage_region_name   varchar(100) COMMENT '管理大区编码',
    end_agent_name           varchar(100) COMMENT '代理区',
    end_franchisee_name      varchar(100) COMMENT '加盟商',
    end_provider_id          varchar(100) COMMENT '省份id',
    end_provider_name        varchar(100) COMMENT '省份',
    end_city_id              varchar(100) COMMENT '城市id',
    end_city_name            varchar(100) COMMENT '城市',
    end_area_id              varchar(100) COMMENT '区县id',
    end_area_name            varchar(100) COMMENT '区县',
    end_network_arrival_time varchar(100) COMMENT '网点到件时间',
    deliver_time             varchar(100) COMMENT '网点出仓时间',
    collect_in_time          varchar(100) COMMENT '时效签收时间',
    difficult_type           varchar(100) COMMENT '问题件类型',
    terminal_type            varchar(100) COMMENT '对接类型',
    deliver_out_time         varchar(100) COMMENT '驿站/快递柜业务员取出时间',
    collect_out_time         varchar(100) COMMENT '出库时间',
    sign_time                varchar(100) COMMENT '签收时间',
    proxy_in_time            varchar(100) COMMENT '代理点收入时间',
    proxy_in_network_name    varchar(100) COMMENT '代理点名称',
    difficult_time           varchar(100) COMMENT '问题件扫描时间',
    deliver_township_name    varchar(100) COMMENT '出仓乡镇',
    deliver_shift            varchar(100) COMMENT '散货班次',
    goods_type_code          varchar(100) COMMENT '物品类型',
    order_source_name        varchar(100) COMMENT '订单来源',
    order_source_code        varchar(100) COMMENT '订单来源编码',
    date_time                date COMMENT '业务日期'
)
    ENGINE = OLAP DUPLICATE KEY(end_agent_code,end_franchisee_code,final_sign_network_code,third_code)
comment '网点滞留件明细'
PARTITION BY RANGE (date_time) (
   START ("2023-01-08") END ("2023-03-09") EVERY (INTERVAL 1 day))DISTRIBUTED BY HASH(final_sign_network_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);

  alter table jms_dm.dm_network_retention_detail_dt add column (
    third_name varchar(100) comment'三段码名字'
    ) ;